﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.cn
{
    public partial class leftimgs : System.Web.UI.UserControl
    {
        // Fields
        public string topic = "";

        // Methods
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                string sql = "select pic,picurl from DB_topic where visible=1 and isnew=1 and location=0 order by topicorder asc";
                DataTable table = SQLAccess.GreatDs(sql).Tables[0];
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        string topic = this.topic;
                        if (row["picurl"].ToString().Trim() == "")
                        {
                            this.topic = topic + "<p><img src='" + row["pic"].ToString() + "' border='0' width='190' /></p>";
                        }
                        else
                        {
                            this.topic = topic + "<p><a href='" + row["picurl"].ToString() + "' target='_blank'><img src='" + row["pic"].ToString() + "' border='0' width='190' /></a></p>";
                        }
                    }
                }
            }
        }

 

    }
}